package com.snow.campuslink.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.snow.campuslink.user.entity.UserMessage;
import com.snow.campuslink.user.mapper.UserMessageMapper;
import com.snow.campuslink.user.service.IUserMessageService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import static cn.hutool.core.bean.BeanUtil.beanToMap;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Gaosl
 * @since 2021-03-02
 */
@Service
public class UserMessageServiceImpl extends ServiceImpl<UserMessageMapper, UserMessage> implements IUserMessageService {

    @Override
    public List<UserMessage> getFocus(UserMessage userMessage) {
        Map<String, Object> map = beanToMap(userMessage, true, true);
        QueryWrapper<UserMessage> userMessageQueryWrapper = new QueryWrapper<>();
        userMessageQueryWrapper.allEq(map);
        return  list(userMessageQueryWrapper);
    }
}
